Refactor Crawler.processPage for better maintainability#41
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Refactored
processPagemethod inplugins/core/src/crawler/crawler.tsinto smaller helper methods (fetchPage,handleCachedResponse,handleRedirects,handleSuccessResponse) to reduce complexity and improve readability.Note: The original task pointed to
plugins/core/src/crawler/crawl.ts, but that file is now a facade for theCrawlerclass. The complexity described was found inCrawler.processPagewithinplugins/core/src/crawler/crawler.ts, so the refactoring was applied there.Changes:
fetchPagefor network requests.handleCachedResponsefor 304 logic.handleRedirectsfor redirect chain processing.handleSuccessResponsefor 200 OK processing.FetchResultandGraphNodetypes instead ofany.processPagelogic in atry/catchblock.PR created automatically by Jules for task 15433885897905652798 started by @saurabhsharma2u